home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / demo / gcp_24.exe / NOTEPAD.FR_ / NOTEPAD.FR
Text File  |  1994-04-28  |  9KB  |  352 lines

  1. VERSION 2.00
  2. Begin Form frmNotePad 
  3.    BackColor       =   &H00000000&
  4.    Caption         =   "VT220 Control Demo from Dart"
  5.    ClientHeight    =   4470
  6.    ClientLeft      =   1260
  7.    ClientTop       =   1770
  8.    ClientWidth     =   6765
  9.    ClipControls    =   0   'False
  10.    DrawStyle       =   5  'Transparent
  11.    FillColor       =   &H00FFFFFF&
  12.    Height          =   5130
  13.    Left            =   1215
  14.    LinkTopic       =   "Form1"
  15.    MDIChild        =   -1  'True
  16.    ScaleHeight     =   4470
  17.    ScaleWidth      =   6765
  18.    Top             =   1155
  19.    Visible         =   0   'False
  20.    Width           =   6855
  21.    Begin GCP_220 VT1 
  22.       Align           =   1  'Align Top
  23.       AutoWrap        =   -1  'True
  24.       BackColor       =   0  'BLACK
  25.       Backspace       =   0  'DEL
  26.       BoldColor       =   3  'CYAN
  27.       CharSet         =   0  'DEC Large
  28.       CommSettings    =   "COM2:9600,n,8,1"
  29.       CursorKeys      =   0  'Normal
  30.       EditKeys        =   0  'DEC Map
  31.       FlowControl     =   2  'Hardware (TRS/CTS)
  32.       ForeColor       =   7  'WHITE
  33.       Height          =   2895
  34.       Keypad          =   0  'Numeric
  35.       Left            =   0
  36.       LocalEcho       =   0   'False
  37.       Password        =   ""
  38.       PasswordPrompt  =   "assword:"
  39.       PrintMode       =   0  'Normal
  40.       Protocol        =   1  'TELNET
  41.       RemoteAddress   =   ""
  42.       TabIndex        =   1
  43.       TermType        =   0  'VT200
  44.       Top             =   0
  45.       Username        =   ""
  46.       UsernamePrompt  =   "ogin:"
  47.       Width           =   6765
  48.    End
  49.    Begin TextBox Text1 
  50.       Height          =   375
  51.       Left            =   360
  52.       TabIndex        =   0
  53.       Text            =   "Text1"
  54.       Top             =   3960
  55.       Visible         =   0   'False
  56.       Width           =   2655
  57.    End
  58.    Begin Menu mnuFile 
  59.       Caption         =   "&File"
  60.       Begin Menu mnuFNewSession 
  61.          Caption         =   "&New..."
  62.       End
  63.       Begin Menu mnuFClose 
  64.          Caption         =   "&Close"
  65.       End
  66.       Begin Menu mnuFSep1 
  67.          Caption         =   "-"
  68.       End
  69.       Begin Menu mnuFPrintScreen 
  70.          Caption         =   "Save Screen"
  71.       End
  72.       Begin Menu mnuFSelectPrinter 
  73.          Caption         =   "Printer Setup..."
  74.       End
  75.       Begin Menu mnuFSep2 
  76.          Caption         =   "-"
  77.       End
  78.       Begin Menu mnuFExit 
  79.          Caption         =   "E&xit"
  80.       End
  81.    End
  82.    Begin Menu mnuEdit 
  83.       Caption         =   "&Edit"
  84.       Begin Menu mnuECopy 
  85.          Caption         =   "&Copy"
  86.       End
  87.       Begin Menu mnuEPaste 
  88.          Caption         =   "&Paste"
  89.       End
  90.       Begin Menu mnuEClear 
  91.          Caption         =   "C&lear"
  92.       End
  93.    End
  94.    Begin Menu mnuOptions 
  95.       Caption         =   "&Options"
  96.       Begin Menu mnuConnect 
  97.          Caption         =   "Connect..."
  98.       End
  99.       Begin Menu mnuDisconnect 
  100.          Caption         =   "Disconnect"
  101.       End
  102.       Begin Menu mnuSep2 
  103.          Caption         =   "-"
  104.       End
  105.       Begin Menu mnuOColor 
  106.          Caption         =   "C&olor..."
  107.       End
  108.       Begin Menu mnuFont 
  109.          Caption         =   "&Font..."
  110.       End
  111.       Begin Menu mnuOKey 
  112.          Caption         =   "&Key Maps..."
  113.       End
  114.       Begin Menu mnuODialup 
  115.          Caption         =   "Dialup Settings..."
  116.       End
  117.       Begin Menu mnuOTerminal 
  118.          Caption         =   "&Terminal..."
  119.       End
  120.       Begin Menu mnuOSep1 
  121.          Caption         =   "-"
  122.       End
  123.       Begin Menu mnuFShowServer 
  124.          Caption         =   "&Show TELNET Server"
  125.       End
  126.       Begin Menu mnuFHideServer 
  127.          Caption         =   "&Hide TELNET Server"
  128.       End
  129.    End
  130.    Begin Menu mnuWindow 
  131.       Caption         =   "&Window"
  132.       WindowList      =   -1  'True
  133.       Begin Menu mnuWCascade 
  134.          Caption         =   "&Cascade"
  135.       End
  136.       Begin Menu mnuWTile 
  137.          Caption         =   "&Tile"
  138.       End
  139.       Begin Menu mnuWArrange 
  140.          Caption         =   "&Arrange Icons"
  141.       End
  142.    End
  143.    Begin Menu mnuHelp 
  144.       Caption         =   "&Help"
  145.       Begin Menu mnuHAbout 
  146.          Caption         =   "About..."
  147.       End
  148.    End
  149. End
  150.  
  151. Sub Form_Load ()
  152.     ExitFlag = False
  153. End Sub
  154.  
  155. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  156.     If (VT1.OpenComm) Then
  157.     Cancel = True
  158.     Me.Caption = FState(Me.Tag).Session & " - closing..."
  159.     VT1.OpenComm = False
  160.     Else
  161.     Cancel = False
  162.     End If
  163. End Sub
  164.  
  165. Sub Form_Resize ()
  166.     If windowstate <> 1 And ScaleHeight <> 0 Then
  167.     VT1.Height = ScaleHeight
  168.     End If
  169. End Sub
  170.  
  171. Sub Form_Unload (Cancel As Integer)
  172.  
  173.     FState(Tag).Deleted = True
  174.     ' Any other forms?
  175.     If (Not Sessions()) Then
  176.     frmMDI.Icon = LoadPicture("net09b.ico")   ' closed icon
  177.     FIndex = 0
  178.     End If
  179.  
  180. End Sub
  181.  
  182. Sub mnuConnect_Click ()
  183.     If frmMDI.ActiveForm.VT1.Protocol = 1 Then 'telnet
  184.     CenterForm frmMDI, ConnectDlg
  185.     ConnectDlg.Show modal
  186.     Else
  187.     CenterForm frmMDI, DialUpDlg
  188.     DialUpDlg.Show modal
  189.     End If
  190. End Sub
  191.  
  192. Sub mnuDisconnect_Click ()
  193.     Disconnect = True
  194.     'reset modem if protocol is async
  195.     'If frmMDI.ActiveForm.VT1.Protocol = 1 Then
  196.     frmMDI.ActiveForm.VT1.OpenComm = False
  197.     'End If
  198. End Sub
  199.  
  200. Sub mnuEClear_Click ()
  201.     VT1.ClearScreen = True
  202. End Sub
  203.  
  204. Sub mnuECopy_Click ()
  205.     VT1.Copy = True
  206. End Sub
  207.  
  208. Sub mnuEPaste_Click ()
  209.     VT1.Paste = True
  210. End Sub
  211.  
  212. Sub mnuFClose_Click ()
  213.     If VT1.OpenComm = False Then
  214.     Unload Me
  215.     Else
  216.     VT1.OpenComm = False
  217.     End If
  218. End Sub
  219.  
  220. Sub mnuFExit_Click ()
  221.     ' Unloading the MDI form invokes the QueryUnload event
  222.     ' for each child form, then the MDI form - before unloading
  223.     ' the MDI form. Setting the Cancel argument to True in any of the
  224.     ' QueryUnload events aborts the unload.
  225.  
  226.     'For i = 1 To Sessions()
  227.     'set exit flag
  228.     ExitFlag = True
  229.     Unload frmMDI
  230.     'Next i
  231.     'Unload Me
  232. End Sub
  233.  
  234. Sub mnuFHideServer_Click ()
  235.     VT1.ShowServer = False
  236. End Sub
  237.  
  238. Sub mnuFNewSession_Click ()
  239.     CenterForm frmMDI, NewSession
  240.     NewSession.Show 1
  241. End Sub
  242.  
  243. Sub mnuFont_Click ()
  244.     'Load CharSetDlg
  245.     CenterForm frmMDI, CharSetDlg
  246.     CharSetDlg.Show modal
  247. End Sub
  248.  
  249. Sub mnuFOpenSession_Click ()
  250.     LoadConfig (PrevSess)
  251. End Sub
  252.  
  253. Sub mnuFPrintScreen_Click ()
  254.     VT1.PrintScreen = "screen"
  255. End Sub
  256.  
  257. Sub mnuFSelectPrinter_Click ()
  258.     VT1.SelectPrinter = True
  259. End Sub
  260.  
  261. Sub mnuFShowServer_Click ()
  262.     VT1.ShowServer = True
  263. End Sub
  264.  
  265. Sub mnuHAbout_Click ()
  266.     frmAbout.Show 1
  267. End Sub
  268.  
  269. Sub mnuHContents_Click ()
  270.     r = Shell("WinHelp.exe vt220fwg.hlp")
  271. End Sub
  272.  
  273. Sub mnuOColor_Click ()
  274.     CenterForm frmMDI, ColorDlg
  275.     ColorDlg.Show modal
  276. End Sub
  277.  
  278. Sub mnuODialup_Click ()
  279.     CenterForm frmMDI, ConfigScrn
  280.     ConfigScrn.Show modal
  281. End Sub
  282.  
  283. Sub mnuOKey_Click ()
  284.     Load Keyboard
  285.     Keyboard.Show modal
  286. End Sub
  287.  
  288. Sub mnuOpenConnect_Click ()
  289.     LoadConfig (OpenPrevSess)
  290. End Sub
  291.  
  292. Sub mnuOTerminal_Click ()
  293.     CenterForm frmMDI, Emulation
  294.     Emulation.Show 1
  295. End Sub
  296.  
  297. Sub mnuWArrange_Click ()
  298.     frmMDI.Arrange ARRANGE_ICONS
  299. End Sub
  300.  
  301. Sub mnuWCascade_Click ()
  302.     frmMDI.Arrange CASCADE
  303. End Sub
  304.  
  305. Sub mnuWTile_Click ()
  306.     frmMDI.Arrange TILE_HORIZONTAL
  307. End Sub
  308.  
  309. Sub Text1_Change ()
  310.     FState(Me.Tag).Dirty = True
  311. End Sub
  312.  
  313. Sub VT1_Console (Message As String)
  314.     MsgBox Message, 64 + 4096, "Console Message from VT-220"
  315. End Sub
  316.  
  317. Sub VT1_OnCloseComm (ErrorCode As Integer)
  318.     If Left$(Me.Caption, InStr(Me.Caption, " ") - 1) = FState(FIndex).Session Then
  319.     Me.Caption = FState(FIndex).Session & " - closed"
  320.     End If
  321.     If ExitFlag Then
  322.        Unload frmMDI
  323.     End If
  324.     If Disconnect = False Then
  325.     Me.Icon = LoadPicture("net09b.ico")   ' closed icon
  326.     Unload Me
  327.     End If
  328.     If FIndex > 0 Then Me.mnuConnect = True
  329. End Sub
  330.  
  331. Sub VT1_OnOpenComm (ErrorCode As Integer)
  332.     If ErrorCode Then
  333.     Me.Caption = FState(Me.Tag).Session & " - closed"
  334.     OpenComm = False
  335.     Icon = LoadPicture("net09b.ico")
  336.     Else
  337.     Me.Caption = FState(Me.Tag).Session & " - open"
  338.     ' Icon shows us open
  339.     frmMDI.Icon = LoadPicture("net09a.ico")
  340.     Icon = LoadPicture("net09a.ico")
  341.     ' if a dialup and init string is not empty, send init string otherwise don't send string and turn dialup off
  342.     If VT1.Protocol = 0 And FState(Me.Tag).ModemInitString > "" Then
  343.         VT1.Output = FState(Me.Tag).ModemInitString & FState(Me.Tag).Dial & FState(Me.Tag).Phone & Chr$(13)
  344.     Else
  345.         Me.mnuODialup = False
  346.     End If
  347.     Me.mnuConnect = False
  348.     End If
  349.     Disconnect = False
  350. End Sub
  351.  
  352.